﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX.Direct3D;
using Microsoft.DirectX;
using System.Drawing;

namespace DirectX_CS
{
    public class EquilibriumPoint 
	{
		public Color Color;
		public float Nx;
		public float Ny;
		public float Nz;    // Summary:
		public Vector3 Normal
		{
			get { return new Vector3(Nx, Ny, Nz); }
			set { Nx = value.X; Ny = value.Y; Nz = value.Z; }
		}
		[PGBrowsable]
		public int Index;

		public EquilibriumPoint()
        {
        }
        public EquilibriumPoint(Vector3 position)
        {
            Position0 = position;
        }
		public EquilibriumPoint(Vector3 position, float zMax)
        {
            Position0 = position;
        }
		//protected float Mass
		//{
		//  get { return mass; }
		//  set { mass = value; }
		//}
		//private float mass = 1.0f; //IN whatever units
		//private float dt = 1.0f;//in whatever units


        //private float surfaceArea = 1.0f;
        
        //private float volume = 1.0f;
        //public float Volume
        //{
        //  get { return volume; }
        //  set { volume = value; }
        //}
		//public const float g = 9.80f; // m/s^2
		
        // public float Density
        //{
        //    get {return mass / volume;}
        //}
		//public Vector3 Velocity
		//{
		//    get { return Speed * Displacement; }
		//}
		//public Vector3 Direction 
		//{
		//    get { 
		//        float len =	 Velocity.Length();
		//        return new Vector3(Velocity.X / len, Velocity.Y / len, Velocity.Z / len); 
		//    }
		//}        
		[PGBrowsable]
		public Vector3 Position
        {
			get { return originalPosition + displacement; }
        }
        private Vector3 originalPosition;
		[PGBrowsable]
		public Vector3 Position0
        {
            get { return originalPosition; }
            set { originalPosition = value; }
        }

		protected Vector3 displacement;
		[PGBrowsable]
		public Vector3 Displacement
		{
			get { return displacement; }
			set { displacement = value; }
		}
		//public float Speed
		//{
		//  get { return Displacement.Length() / dt;}
		//}
		//public Vector3 Acceleration
		//{
		//    get
		//    {
		//        float len = Velocity.Length();
		//        float len2 = Velocity.LengthSq();//len * len;   //same as doing it myself but safes processing
		//        return new Vector3(Velocity.X / len2, Velocity.Y / len2, Velocity.Z / len2);
		//    }
		//}

		public SVector GetSVector()
		{
			return new SVector(this.Position,this.Normal, this.Color.ToArgb());
		}

        //public float time
        //{   
        //    get { return mTime;}
        //}

		//
        //acceleration
        //public Vector3 Force
        //{
        //    get { return new Vector3(0,0,0);}
        //}
        //public Vector3 ForceVector
        //{
        //    get { return new Vector3(0,0,0);}
        //}
        
    }
}
